﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="YuanLiao_CaiGou_JiHua_JingYan.aspx.cs" Inherits="syc.Sale.YuanLiao_CaiGou_JiHua_JingYan" %>

<head runat="server">
    <title></title>
    <style type="text/css">
        .button
        {}
    </style>
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>
  <form id="form1" runat="server">
    <div id="wintop" class="wintop">
        原料采购量</div>
     <asp:Panel ID="Panel1" runat="server" CssClass="panel">
        <asp:Button ID="Button_Delete" runat="server" Text="删 除" CssClass="button" 
            UseSubmitBehavior="False" onclick="Button_Delete_Click" OnClientClick="if(!confirm('确认删除该条记录吗?')) return false;" />     
         <input id="Button" type="button" value="返回"  
             onclick="document.location.href='YuanLiao_CaiGou_JiHua_Search.aspx'" class="button" />
    </asp:Panel>
     <asp:Panel ID="Panel2" runat="server" CssClass="panel">
        <table style="width: 100%;font-size:13px;">
            <tr>
                <td width="100" align="right">产品名称：

                </td>
                <td valign="top">

                    <asp:DropDownList ID="ChanPin" runat="server" Width="200px" 
                        DataTextField="品名规格" DataValueField="ID" 
                        AutoPostBack="True" onselectedindexchanged="YuanLiao_SelectedIndexChanged" 
                        style="margin-bottom: 0px">
                    </asp:DropDownList>
                </td>
            </tr>  
            <tr>
                <td style="text-align: right" width="100">
                    生产计划：</td>
                <td valign="top">
                    <asp:DropDownList ID="ShengChanJiHua" runat="server" AutoPostBack="True" 
                        DataTextField="名称" DataValueField="ID" 
                        Width="200px" onselectedindexchanged="ShengChanJiHua_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
            </tr>      
            <tr>
                <td style="text-align: right" width="100">
                    生产计划量：</td>
                <td valign="top">
                    <asp:TextBox ID="ShengChanJiHuaLiang" runat="server" Width="200px" 
                        CssClass="intxt1" Enabled="False"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="text-align: right" width="100">
                    现有库存量：</td>
                <td valign="top">
                    <asp:TextBox ID="KuCunLiang" runat="server" Width="200px" CssClass="intxt1" 
                        Enabled="False"></asp:TextBox>
                </td>
            </tr>
              <tr>
                <td style="text-align: right" width="100">
                    经验系数：</td>
                <td valign="top">
                    <asp:TextBox ID="JingYanZhi" runat="server" Width="200px"  onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false" ></asp:TextBox>
                </td>
            </tr>
             <tr>
                <td style="text-align: right" width="100">
                    原料名称：</td>
                <td valign="top">
                    <asp:DropDownList ID="YuanLiao" runat="server" Width="200px" 
                        DataTextField="品名" DataValueField="ID" AutoPostBack="True" 
                        onselectedindexchanged="YuanLiao_SelectedIndexChanged" >
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td style="text-align: right" width="100">
                   计划采购量：</td>
                <td valign="top">
                    <asp:TextBox ID="CaiGouLiang" runat="server" Width="200px" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"></asp:TextBox>
                    <asp:Button ID="Calculate" runat="server" CssClass="button" Text="计算" 
                        onclick="Calculate_Click" />
                    <asp:Button ID="Save" runat="server" CssClass="button" Text="保存" 
                        onclick="Save_Click" />
                </td>
            </tr>

        </table>

    </asp:Panel>

    <asp:Panel ID="Panel3" runat="server" CssClass="panel2" >
        <asp:Label ID="Message" runat="server" Text="·准备就绪" CssClass="prompt"></asp:Label>
    </asp:Panel>
    
    
   <div class="gridframe">
        <div class="gridview">
        
            <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#d0d0d0">
	            <tr>
		            <td class="grid-title">采购计划</td>
		        </tr>
		        <tr>
		            <td class="grid-back">
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>"  
                              SelectCommand="select 采购明细.ID,采购计划.计划名称 as 采购计划,生产计划.名称 as 生产计划,原料.品名 ,库存量,计划采购量 from 采购明细 
inner join 采购计划 on 采购计划.ID=采购明细.采购计划ID inner join 生产计划 on 生产计划.ID=采购明细.生产计划ID
inner join 原料 on 原料.ID=采购明细.原料ID where 采购计划ID"
                            ></asp:SqlDataSource>
                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                             AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID" 
                            GridLines="None" ondatabound="GridView1_DataBound" 
                            onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
                            UseAccessibleHeader="False" DataSourceID="SqlDataSource1" >
                            <PagerSettings Visible="False" />
                            <RowStyle CssClass="grid-row-normal" />
                            <SelectedRowStyle   CssClass="grid-row-bright" />
                            <Columns>
                             <asp:TemplateField HeaderText="">
                                    <ItemTemplate>
                                        <asp:Button ID="Button1" runat="server" CommandName="Select" Text="选择" CssClass="hide"/>
                                        <img src="/Icons/online.gif" style="margin-top:2px;" alt="" />
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="20px" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False"  ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    SortExpression="ID" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle HorizontalAlign="Center" CssClass="grid" Width="80px"></ItemStyle>
                                </asp:BoundField>
                                
                                <asp:BoundField DataField="采购计划" HeaderText="采购计划" SortExpression="采购计划" 
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-Width="100" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle CssClass="grid" Width="100px"></ItemStyle>
                                </asp:BoundField>
                    
                                <asp:BoundField DataField="生产计划" HeaderText="生产计划" SortExpression="生产计划" 
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-Width="160" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle CssClass="grid" Width="160px"></ItemStyle>
                                </asp:BoundField>
                   
                                <asp:BoundField DataField="品名" HeaderText="原料名称" SortExpression="原料名称" 
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-Width="100" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle CssClass="grid" Width="100px"></ItemStyle>
                                </asp:BoundField>    
                                  
                                <asp:BoundField DataField="库存量" HeaderText="库存量(吨)" SortExpression="库存量" 
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header" ItemStyle-HorizontalAlign="right"
                                    ItemStyle-Width="100" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle CssClass="grid" Width="100px"></ItemStyle>
                                </asp:BoundField>    
                                
                                <asp:BoundField DataField="计划采购量" HeaderText="计划采购量（吨）" SortExpression="计划采购量" 
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-HorizontalAlign="center" ItemStyle-Width="100" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle HorizontalAlign="Center" CssClass="grid" Width="100px"></ItemStyle>
                                </asp:BoundField>
                                <asp:BoundField DataField="日期" DataFormatString="{0:d}" HeaderText="日期" 
                                    SortExpression="日期" ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-HorizontalAlign="center" ItemStyle-Width="100" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle HorizontalAlign="Center" CssClass="grid" Width="100px"></ItemStyle>
                                </asp:BoundField>
                            </Columns>
                          </asp:GridView>
		            </td>
	            </tr>
	            <tr>
		            <td>   
		                <table width="100%">
		                    <tr>
		                        <td class="pagebar">
                                    <asp:Button ID="Button_Pager_First" runat="server" Text="" ToolTip="首页" 
                                        CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                    <asp:Button ID="Button_Pager_Prev" runat="server" Text="" ToolTip="上一页" 
                                        CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                    <input type="button" class="page-split" />第<asp:TextBox ID="TextBox_Pager" runat="server" CssClass="pageturn" 
                                        ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" /><asp:Label ID="Label_Pages" runat="server"></asp:Label><input type="button" class="page-split" />
                                    
                                    <asp:Button ID="Button_Pager_Next" runat="server" Text="" ToolTip="下一页" 
                                        CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                    <asp:Button ID="Button_Pager_Last" runat="server" Text="" ToolTip="末页" 
                                        CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" />
                                </td>
                                <td align="right">
                                    <asp:Label ID="Label_Total" runat="server" CssClass="grid_totalrows"></asp:Label>
                                </td>
                            </tr>
                       </table>

		            </td>
	            </tr>
            </table>
            

        </div>
    </div>
    
    </form>
<script>
    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "textbox") {
            textboxs[i].onchange = function(e) { this.className = "textbox-changed"; };
            textboxs[i].onfocus = function(e) { this.select(); };
        }
        else if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }

    }
    var rows = document.getElementsByTagName("tr");
    for (i = 0; i < rows.length; i++) {

        if (rows[i].className == "grid-row-normal") {
            rows[i].onmouseover = function() { this.className = "grid-row-bright"; };
            rows[i].onmouseout = function() { this.className = "grid-row-normal"; };
            rows[i].onclick = function() { this.firstChild.firstChild.click(); };
        }
    }
    var tds = document.getElementsByTagName("td");
    for (i = 0; i < tds.length; i++) {
        if (tds[i].className == "detailheader") {
            tds[i].innerHTML = tds[i].innerHTML.replace("*", "<span class=required>*</span>");
        }
    }

</script>
</body>
</html>
